/**
 * Created by dazq on 16/11/23.
 */
import React, { Component } from 'react';
import { View, Text,TextInput,TouchableHighlight } from 'react-native';
import { Actions } from 'react-native-router-flux';

export default class PageOne extends Component {
    // 构造
      constructor(props) {
        super(props);
        // 初始状态

      }

    componentWillMount() {
        this.state = {
            text:''
        };
    }
    render() {
        return (
            <View style={{margin: 128}}>

                <TextInput
                    style={{height: 40}}
                    placeholder="Type here to translate!"
                    onEndEditing={(event) => this.setState({text:event.nativeEvent.text})}
                />
                <TouchableHighlight  onPress={()=>{Actions.listView({data:this.state.text})}}>
                    <Text  style={{marginBottom:20}}>{this.state.text}</Text>
                </TouchableHighlight>
            </View>
        )
    }
}